module.exports = {
    title: 'zm-ui基础组件文档库',
    description: '基于Element-ui二次封装基础组件示例',
    base: '/',
    // port: 6666,
    // dest: './dist',   // 设置输出目录
    head: [
        ['link', { rel: 'shortcut icon', type: 'image/x-icon', href: `./favicon.ico` }]
    ],
    markdown: {
        // lineNumbers: true // 代码块显示行号
    },
    themeConfig: {
        nav: [
            { text: '主页', link: '/' },
            { text: '基础组件', link: '/baseComponents/' },

        ],
        sidebar: {
            '/baseComponents/': [{
                title: '通用组件',
                collapsable: false,
                children: [
                    'input/base', // input组件
                ]
            }, ],
        }
    },
    chainWebpack(config) {
        config.resolve.alias.set('core-js/library/fn', 'core-js/features');
    },
    configureWebpack: {
        module: {
            rules: [{
                test: /\.tsx?$/,
                exclude: /node_modules/,
                use: [
                    'cache-loader',
                    {
                        loader: 'babel-loader',
                        options: {
                            babelrc: false,
                            configFile: false,
                            presets: [
                                '@babel/preset-env', // 可以识别es6语法
                                '@vue/babel-preset-jsx' // 解析jsx语法
                            ]
                        }
                    },
                    {
                        loader: 'ts-loader',
                        options: {
                            appendTsxSuffixTo: [/\.vue$/, /\.md$/]
                        }
                    }
                ]
            }]
        }
    },
    plugins: [
        [
            'vuepress-plugin-typescript',
            {
                tsLoaderOptions: {
                    // ts-loader 的所有配置项
                },
            },
        ],
        // ['@vuepress/plugins-back-to-top', false],
        ['vuepress-plugin-gotop-plus', {
            // mobileShow: false,
            threshold: 150
        }],
        '@vuepress-reco/extract-code'
    ]
}